#ifndef HELP_WINDOW_H
#define HELP_WINDOW_H

#include <gtk/gtk.h>

class HelpWindow {
public:
    HelpWindow();
    ~HelpWindow();
    
    bool init();
    void show();
    void hide();
    GtkWidget* get_window();

private:
    GtkBuilder *builder;
    GtkWidget *window;
    GtkWidget *helpTreeView;
    GtkWidget *popupMenu;
    
    // 右键菜单回调函数
    static gboolean on_treeview_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer data);
    static void on_menu_edit_clicked(GtkMenuItem *menuitem, gpointer data);
    static void on_menu_save_clicked(GtkMenuItem *menuitem, gpointer data);
    // 双击事件处理函数
    static gboolean on_treeview_row_activated(GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer data);
    // 单元格编辑回调函数
    static void on_cell_edited(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer data);
    
    // 辅助函数
    void create_popup_menu();
    void save_treeview_content_to_file();
};

#endif // HELP_WINDOW_H